<?php 
session_start();
 include_once('connection/connection.php');
 include('config.php');
 include('header.php');
 include('menu.php');

	$frm=$_REQUEST['form_id'];
 	if(isset($_REQUEST['form_id'])){
	 $_SESSION['frm_unique_id']=$frm;
 	}
 	$frm =  $_SESSION['frm_unique_id'];
//function call for removing blank space from an array
function blanck($var)
{
if($var!="")
{
    return $var;
}
}
//function call for convert id into name
function getName($colName,$id) 
{
	$sqlgetName="select distinct ".$colName."_name from tbl_lookup_location where ".$colName."_id in(".$id.")";
	$querygetName=mysql_query($sqlgetName);
	while($rowgetName=mysql_fetch_row($querygetName))
	{
	$name=$name."-".$rowgetName[0];
	}

	$name=explode("-",$name);
	$name=array_filter($name, "blanck");
	return $name=implode($name,",");
}
//fetch all information based on form_id
//$frm=$_SESSION['form_id'];
$qr="select * from tbl_dtls_q1_main where id='$frm'";
$res=mysql_query($qr);
$row=mysql_fetch_array($res);
$dis=$row['district_id'];
$sch=$row['type_scheme'];

$query_population_factor="select population_factor from tbl_lookup_pop_factor where district_id='$dis'";
$result_population_factor=mysql_query($query_population_factor);
$population_factor=mysql_fetch_array($result_population_factor);
$populationFactor=$population_factor['population_factor'];


$dis_name=getName('district',$dis);
$_SESSION['dis_name']=$dis_name;
$tehsil=$row['tehsil_id'];
$id1=$row['id'];

$reference_id=$row['form_id'];
$_SESSION['id1']=$id1;
$qr1="select census_subdistrict_name from tbl_lookup_location where district_id='$dis' and census_subdistrict_code='$tehsil'";
$res1=mysql_query($qr1);
$row1=mysql_fetch_array($res1);
?>
<script language="javascript" src="js/cal2.js">
/*
Xin's Popup calendar script-  Xin Yang (http://www.yxscripts.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
</script>
<script language="javascript" src="js/cal_conf2.js"></script>
<script language="javascript">
function enable_sanc1(status)
{
  
	if(document.getElementById('scheme_sactioned')[document.getElementById('scheme_sactioned').selectedIndex].value=='Other')
	{
  		status=!status;
  		document.getElementById('scheme_sactioned_other').disabled=status;
  		document.getElementById('scheme_sactioned_other').focus();
	}
	else
	{
		document.getElementById('scheme_sactioned_other').disabled=true;	
	}

}
</script>
<!-- face file start -->
<script src="facefiles/jquery-1.2.2.pack.js" type="text/javascript"></script>
<link href="facefiles/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="facefiles/facebox.js" type="text/javascript"></script>

<script type="text/javascript">
    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox() 
    })
	
</script>
<script language="javascript" type="text/javascript">
function PrintContent()
{
	var DocumentContainer = document.getElementById('reportdiv');
	var WindowObject = window.open('PrintWindow','','width=900,height=760,scrollbars=1');
	WindowObject.document.writeln(DocumentContainer.innerHTML);
	WindowObject.document.close();
	WindowObject.focus();
	WindowObject.print();
	WindowObject.close();
	window.close();
}
</script>
<style type="text/css">
<!-- end face file -->

<!--
.heading_bgclr{
background-color:#CCCCCC;
}
.section_heading
{
	border:#666666 1px solid;
	width:780px;
	height:22px;
	color:#FFFFFF;
	font-size:12px;
	font-weight:600;
	font-family:arial;

}
.section_format
{
	background:#FFFFFF;
	width:780px;
}
.section_format table
{
	border-collapse:collapse;
	border-color:#666666;
	background-color:#EEEEEE;
	width:780px;
}
.section_format
{
	font-size:8.5pt;
	font-family:Verdana, Arial, Helvetica, sans-serif;
	color:#000000;
}
.section_format td
{
	height:25px;
}
-->
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="animatedcollapse.js"></script>

<script type="text/javascript">

animatedcollapse.addDiv('section1', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section2', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section3', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section4', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section5', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section6', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section7', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section8', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section9', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section10', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section11', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section12', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section13', 'fade=1,height=0px,persist=1,hide=0')

animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
	//$: Access to jQuery
	//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
	//state: "block" or "none", depending on state
}

animatedcollapse.init()
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/speechbubbles.css" />

<script src="js/speechbubbles.js">

/***********************************************
* Speech Bubbles Tooltip- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

</script>
<script type="text/javascript">

jQuery(function($){ //on document.ready
 	//Apply tooltip to links with class="addspeech", plus look inside 'speechdata.txt' for the tooltip markups
	$('a.addspeech').speechbubble({url:'speechdata.txt'})
})

function insert_pop_sec4(pop_value){
alert(pop_value);
$("#population").html("<input type='text' value='"+ pop_value +"' id='pop_text' /><input type='button' value='Save' />");
}
</script>
<script type="text/javascript" src="js/ajaxFunction_q1_new.js"></script>
<script type="text/javascript" src="js/validate.js"></script>
<div id="reportdiv">
<div align="center" id="main_div">
<table border="0" width="786" id="main_table" align="center" style="padding-top:10px;">
<tr><td width="71" align="right"><a href="schemewiseListRWSS.php"><font face="Verdana" style="font-size: 8.5pt" color="#993333"><b>Main Back</b></font></a></td>
  <td width="705" align="right"><input type="button" name="submit" value="Print" class="incmbutton" onClick="return PrintContent()" /><?php echo '<a href="ListRWSSscheme.php?DT='.$dis.'&TS='.$sch.'"><font face="Verdana" style="font-size: 8.5pt" color="#993333"><b>Back</b></font></a>';?></td>
<tr><td colspan="2" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section1')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;1. Scheme Details</div></a>
 </td> </tr>
  <tr><td colspan="2">
   <div id="section1" class="section_format">	
  <table border="1">
    <tr>
      <td colspan="2" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="sectionrwss_edit_view.php?var=<?php echo $frm;?>" rel="facebox" style="text-decoration:none"><img src="images/edit.gif" border="0" title="EDIT RECORD" /></a></div></td>
      </tr>
    <tr>
      <td width="400">&nbsp;<b>Type of the Scheme (As of Now)</b></td>
      <td width="400">&nbsp;<?php if($row['type_scheme']=="Sanitary Diggs"){echo "Sanitary Diggi";}else{echo "$row[type_scheme]";}?></td>
      </tr>
    <tr>
      <td>&nbsp;<b>Name of the Scheme</b></td>
      <td>&nbsp;<?php echo "$row[name_scheme]";?></td>
      </tr>
    <tr>
      <td>&nbsp;<b>Year of Commissioning</b></td>
      <td>&nbsp;<?php if($row['year_comm']==0){echo "Not Provided";}else{echo "$row[year_comm]";}?></td>
      </tr>
    <tr>
      <td>&nbsp;<b>Capital Cost (in <img src="images/26rup1.jpg" width="10"> Lakh)</b></td>
      <td>&nbsp;<?php echo "$row[capital_cost]";?></td>
      </tr>
	  <tr>
      <td>&nbsp;<b>Scheme Sanctioned Under</b></td>
      <td>&nbsp;<?php echo "$row[scheme_sactioned]";?></td>
      </tr>
  </table>
  </div>   <!-- End of section1  -->
</td></tr>
<tr>
<td colspan="2" bgcolor="#C5D8EB">
  <a href="javascript:animatedcollapse.toggle('section2')">
  <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;<b>2. Location Details</b></div></a>  </td></tr>
  <tr><td colspan="2">
  <div id="section2"  class="section_format">	
  <table border="1">
    <tr>
      <td colspan="8" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="multiple_edit_view.php?var=<?php echo $frm;?>& id=<?php echo "$row[form_id]";?>& populationFactor=<?php echo $populationFactor;?>" rel="facebox" style="text-decoration:none"><img src="images/edit.gif" border="0" title="EDIT RECORD" /></a></div><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="add_rwss_village.php?var=<?php echo $frm;?>& id=<?php echo "$row[form_id]";?>" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" title="ADD RECORD" style="border:none" /></a></div></td>
      </tr>
    <tr>
      <td width="271">&nbsp;<b>District</b></td>
      <td width="142">&nbsp;<?php $id="$row[district_id]"; echo getName('district',$id);?></td>
      <td width="117" colspan="3">&nbsp;<b>Block</b></td>
      <td colspan="3">&nbsp;<?php $id="$row[block_id]"; echo getName('block',$id);?></td>
    </tr>
    <tr>
      <td valign="top">&nbsp;<b>Gram Panchayat</b></td>
      <td style="padding-left:5px" valign="top"><?php  $id="$row[panchayat_id]"; echo wordwrap(getName('panchayat',$id), 20, "\n", true);?></td>
      <td colspan="3" valign="top">&nbsp;<b>Village Name</b></td>
      <td colspan="3" style="padding-left:5px" valign="top"><?php $id="$row[village_id]";if($id==""){echo "<font color='red'>NO DATA</font>";}else{ echo wordwrap(getName('village',$id), 20, "\n", true);}?></td>
    </tr>
    <tr>
      <td valign="top">&nbsp;<b>Census Village Code</b></td>
      <td style="padding-left:5px" valign="top"><?php echo wordwrap($row['cvc'], 20, "\n", true);?></td>
      <td colspan="3" valign="top">&nbsp;<b>Referenece Id</b></td>
      <td colspan="3" valign="top">&nbsp;<?php echo "$row[form_id]";?></td>
    </tr>
    <tr>
      <td style="padding-left:5px"><b>Population Benefited (as per 2001 census)</b></td>
      <td>&nbsp;<?php echo "$row[population_benefited]";?></td>
      <td colspan="3" style="padding-left:5px;"><b>Present Population</b></td>
      <td colspan="3">&nbsp;<?php echo "$row[present_population]";?></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr style="background-color:#DADADA">
      <td colspan="8">&nbsp;<b>Habitation (MH/OH) Covered</b></td>
      </tr>
    <tr class="heading_bgclr">
      <td>&nbsp;<b>Name of Habitation</b></td>
      <td style="padding-left:5px"><b>Code No.(As per IMIS)</b></td>
      <td>&nbsp;<b>Type<br /> MH/ OH</b></td>
      <td>&nbsp;<b>HP</b></td>
      <td>&nbsp;<b>SP</b></td>
      <td><b>Actual Status at Site (E/NT)</b></td>
      <td colspan="2" style="padding-left:5px"><b>Actual Status of coverage</b></td>
      </tr>
	           <?php
				//fetch all habitation list from q1 using order by habitation code
				$qr2="select distinct id,habit_name,habit_code,type_habit,status_e_nt,status_covered,HP,SP from tbl_dtls_q1_oh where loc_id='".$id1."' order by habit_code asc";
				$res2=mysql_query($qr2);
				while($row2=mysql_fetch_array($res2))
				{
				?>
    <tr>
      <td>&nbsp;<?php echo "$row2[habit_name]";?></td>
      <td>&nbsp;<?php echo "$row2[habit_code]";?></td>
      <td>&nbsp;<?php echo "$row2[type_habit]";?></td>
      <td>&nbsp;<?php echo "$row2[HP]";?></td>
      <td>&nbsp;<?php echo "$row2[SP]";?></td>
      <td width="106">&nbsp;<?php if($row2['status_e_nt']=="NON TRACAB"){echo "NOT TRACEABLE";}elseif($row2['status_e_nt']=="Existing"){ echo "EXISTING";}?></td>
      <td width="87">&nbsp;<?php echo ($row2['status_covered']=="1")? "COVERED" : "NOT COVERED" ; ?></td>
      <td width="17" align="center"><a href="rwss_sec2_edit.php?var=<?php echo $row2['id'];?>&amp; referenceId=<?php echo $reference_id;?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
    </tr>
	            <?php } ?>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="3">&nbsp;</td>
      <td colspan="3">&nbsp;</td>
    </tr>
  </table>
  </div>  <!-- End of section2  -->
  </td></tr>
  <tr><td colspan="2" bgcolor="#C5D8EB">
  <a href="javascript:animatedcollapse.toggle('section3')">
  <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;3. Sources Details</div></a>
  </td></tr>
  <tr><td colspan="2">
  <div id="section3" class="section_format">
  <table border="1">
    <tr>
      <td colspan="11" align="right"><div style="float:right; border-left:1px solid #CCCCCC; width:35px"><a href="sourcerwss_add_view.php?addloc=<?php echo $id1;?>& referenceId=<?php echo $reference_id;?>" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" border="0" title="ADD RECORD" /></a></div><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"></div></td>
      </tr>
    <tr class="heading_bgclr" style="background-color:#DADADA">
      <td width="70">&nbsp;<b>Source</b></td>
      <td width="80">&nbsp;<b>Current Status</b></td>
      <td width="87">&nbsp;<b>Location</b></td>
      
      <td width="81">&nbsp;<b>Latitude</b></td>
	  <td width="93">&nbsp;<b>Longitude</b></td>
      <td width="65">&nbsp;<b>Yield (Min) KL/day</b></td>
	  <td width="65">&nbsp;<b>Yield (Max) KL/day</b></td>
      <td width="66">&nbsp;<b>Water Table (Min) (M)</b></td>
      <td width="66">&nbsp;<b>Water Table (Max) (M)</b></td>
      <td width="21">&nbsp;</td>
      <td width="16">&nbsp;</td>
    </tr>
	<?php
		$qr2="select * from tbl_dtls_q1_sws where loc_id='$id1'";
		$res2=mysql_query($qr2);
		while($rowSws=mysql_fetch_array($res2))
		{
	?>
    <tr>
      <td>&nbsp; <a class="addspeech" href="#" style="text-decoration:none" title="
	  <?php
	  if($rowSws['pH']=="" && $rowSws['TDS']=="" && $rowSws['Cl']=="" && $rowSws['F']=="" && $rowSws['no3']=="")
	  {
	  echo "<font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='red' style='font-size:12px'><b>No records for water quality parameter!</b></font>";
	  }else{
	  ?>
	  <table width='344' border='1' style='border:1px solid #CCCCCC'>
  <tr>
    <td colspan='5' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>Water Quality Parameter</font></td>
  </tr>
  <tr>
    <td width='52' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>pH</font></td>
    <td width='73' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>TDS(mg/l)</font></td>
    <td width='62' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>Cl(mg/l)</font></td>
    <td width='60' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>F(mg/l)</font></td>
    <td width='63' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>NO<sub>3</sub>(mg/l)</font></td>
  </tr>
  <tr>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowSws[pH]";?></font></td>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowSws[TDS]";?></font></td>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowSws[Cl]";?></font></td>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowSws[F]";?></font></td>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowSws[no3]";?></font></td>
  </tr>
</table><?php }?>
"><?php echo "$rowSws[source]";?></a></td>
      <td>&nbsp;<?php echo ($rowSws['current_status']==='operation')?'Operational':'Defunct';?></td>
      <td>&nbsp;<?php echo "$rowSws[location]";?></td>
	  <td>&nbsp;<?php echo "$rowSws[latitude]";?></td>
      <td>&nbsp;<?php echo "$rowSws[longitude]";?></td>
      
      <td>&nbsp;<?php echo "$rowSws[yield_min]";?></td>
	  <td>&nbsp;<?php echo "$rowSws[yield_max]";?></td>
      <td>&nbsp;<?php echo "$rowSws[water_table_min]";?></td>
      <td>&nbsp;<?php echo "$rowSws[water_table_max]";?></td>
      <td align="center"><a href="sourcerwss_edit_view.php?var=<?php echo $rowSws['id'];?>& referenceId=<?php echo $reference_id;?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
      <td align="center"><a href="sourcerwss_delete_view.php?var=<?php echo $rowSws['id'];?>& loc=<?php echo $rowSws['loc_id'];?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
    </tr>
	<?php 
 		}
	?>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
	  <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
 </div>  <!-- End of Section3  -->
 </td></tr>
 <tr><td colspan="2" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section4')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;4. Handpump and Single Phase / Engineering Aspect</div>
   </a>
 </td> </tr>
  <tr><td colspan="2">
   <div id="section4" class="section_format">	
  <table border="1">
    <tr>
      <td colspan="3" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"></div></td>
    </tr>
    <tr style="background-color:#DADADA">
      <td colspan="3">&nbsp;<b>Handpump and Single Phase Installed (on above mentioned if any)</b></td>
      </tr>
    <tr>
      <td width="381">&nbsp;<b>Handpump Nos.</b></td>
      <td width="199">&nbsp;<?php
	 // $hp_query = mysql_query("SELECT count(id) as total_hp from tbl_dtls_hp_details_q1 where loc_id = $frm and hp_sp='HP'");
	//  $hp_query_detail = mysql_fetch_assoc($hp_query);
	 // echo $hp_query_detail['total_hp']."&nbsp;out of ".$row['hp_nos'];
	  	  ?>
	  <?php
	  $hp_query = mysql_query("SELECT sum(HP) as total_hp from tbl_dtls_q1_oh where loc_id = $frm");
	  $hp_query_detail = mysql_fetch_assoc($hp_query);
	  if($hp_query_detail['total_hp']!=0)
	  {
	  echo $hp_query_detail['total_hp'];
	  }else{
	  
	  echo $row['hp_nos'];
	  }
	  
	  ?>
	  </td>
      <td width="178">
	  <!--<a class="menu" href="HP_detail.php?id=<?php echo $frm ;?>" style="text-decoration:none;" onClick="window.open(this.href,'','width=1200,height=400,scrollbars=yes');return false" title="Add/Edit HP Detail">&nbsp;Add/Edit/Delete HP Details</a>-->&nbsp;Add/Edit/Delete HP Details</td>
    </tr>
    <tr>
      <td>&nbsp;<b>Single Phase Nos.</b></td>
      <td>&nbsp;<?php
	 // $hp_query = mysql_query("SELECT count(id) as total_sp from tbl_dtls_hp_details_q1 where loc_id = $frm and hp_sp='SP'");
	 // $hp_query_detail = mysql_fetch_assoc($hp_query);
	 // echo $hp_query_detail['total_sp']."&nbsp;out of ".$row['sp_nos'];
	  
	  ?>
	   <?php
	  $hp_query = mysql_query("SELECT sum(SP) as total_sp from tbl_dtls_q1_oh where loc_id = $frm");
	  $hp_query_detail = mysql_fetch_assoc($hp_query);
	   if($hp_query_detail['total_sp']!=0)
	  {
	  echo $hp_query_detail['total_sp'];
	  }else{
	  
	  echo $row['sp_nos'];
	  }
	  
	  
	  ?>
	  </td>
      <td>
	  <!--<a class="menu" href="SP_detail.php?id=<?php echo $frm ;?>" style="text-decoration:none;" onClick="window.open(this.href,'','width=1200,height=400,scrollbars=yes');return false" title="Add/Edit SP Detail">&nbsp;Add/Edit/Delete SP Details</a>-->&nbsp;Add/Edit/Delete SP Details</td>
    </tr>
    <tr>
      <td colspan="3">&nbsp;<b>Design Parameter</b></td>
      </tr>
    <tr>
      <td>&nbsp;<b>Population ( As per Design )</b></td>
      <td>&nbsp;<?php echo "$row[population]";?></td>
      <td >&nbsp;<a href="populationrwss_insert.php?id=<?php echo $frm;  ?>&&val=<?php echo $row['population']; ?>&&ref=<?php echo $reference_id; ?>&&dis=<?php echo $dis; ?>" rel="facebox"  style="text-decoration:none"><img src="images/edit.gif" border="0" title="EDIT RECORD" /></a></td>
    </tr>
	  <tr>
      <td>&nbsp;<b>Water Demand (As per Design ) in KLD</b></td>
      <td>&nbsp;<?php echo "$row[water_demand]";?></td>
      <td>&nbsp;<a href="Javascript:void(0);" onClick="insert_watdem_sec4(<?php echo $row['population'];  ?>);" style="text-decoration:none"></a></td>
	  </tr>
  </table>
  </div>   <!-- End of section4  -->
  <div id="editsection4" style="display:none" class="section_format">
  <form action="section4.php" method="post" name="sec4" id="sec4">
  <div style="height:30px" align="center"><?php echo $reference_id;?></div>
  <table border="1">
   
    <tr>
      <td colspan="2">&nbsp;Handpump and Single Phase Installed (on above mentioned if any)</td>
      </tr>
    <tr>
      <td width="400">&nbsp;Handpump Nos.</td>
      <td width="400">&nbsp;<input type="text" name="hp_nos" value="<?php echo $row['hp_nos'];?>" /><input type="hidden" name="frm" value="<?php echo $frm;?>" /></td>
      </tr>
    <tr>
      <td>&nbsp;Single Phase Nos.</td>
      <td>&nbsp;<input type="text" name="sp_nos" value="<?php echo $row['sp_nos'];?>" /></td>
      </tr>
    <tr>
      <td colspan="2">&nbsp;Design Parameter</td>
      </tr>
    <tr>
      <td>&nbsp;Population ( As per Design )</td>
      <td>&nbsp;<input type="text" name="population" value="<?php echo $row['population'];?>" /></td>
      </tr>
	  <tr>
      <td>&nbsp;Water Demand (As per Design ) in KLD</td>
      <td>&nbsp;<input type="text" name="water_demand" value="<?php echo $row['water_demand'];?>" /></td>
      </tr>
	   <tr>
      <td align="center" colspan="2"><input type="submit" value="EDIT" name="sec4_edit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px; font-weight:bold; background:#666666; color:#FFFFFF; width:140px; height:30px" onClick="view_validate()"></td>
      </tr>
  </table>
  </form>
  </div>
</td></tr>
<tr><td colspan="2" bgcolor="#C5D8EB">
  <a href="javascript:animatedcollapse.toggle('section5')">
  <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;5. Assets (As in records) index map for regional scheme to be provided in whatever form is available</div></a>
  </td></tr>
  <tr><td colspan="2">
  <div id="section5" class="section_format">
  <table border="1">
    
    <tr style="background-color:#DADADA">
      <td colspan="10">&nbsp;<b>Pumping Machinery</b></td>
      </tr>
	  <tr style="background-color:#CCCCCC">
      <td colspan="8">&nbsp;<b>Submersible</b></td>
      <td colspan="2" align="right"><a href="assetrwss_add_view.php?addloc=<?php echo $id1;?>& referenceId=<?php echo $reference_id;?>& code=1" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" border="0" title="ADD RECORD" /></a></td>
	  </tr>
    <tr>
      <td width="113">&nbsp;<b>Submersible</b></td>
      <td width="93">&nbsp;<b>Location</b></td>
      <td width="80">&nbsp;<b>Latitude</b></td>
      <td width="93">&nbsp;<b>Longitude</b></td>
      <td width="66">&nbsp;<b>Status</b></td>
      <td width="98" style="padding-left:5px"><b>Discharge (lpm)</b></td>
	  <td width="57" style="padding-left:5px"><b>Head (m)</b></td>
      <td colspan="3" style="padding-left:5px"><b>Power Rating (in HP)</b></td>
    </tr>
	 <?php
         //fectch submersible record orderly
  $i=1;
		$qrySub="select * from tbl_dtls_q1_asset where loc_id='$id1' and asset_id LIKE 'Sub%' order by 0+replace(asset_id,'Sub','')";
		$resSub=mysql_query($qrySub);
		while($rowSub=mysql_fetch_array($resSub))
		{
	?>
    <tr>
      <td>&nbsp; <?php //echo substr($rowSub['asset_id'],0,3).$i;
	  $str= preg_split("/[0-9]/", $rowSub['asset_id']);
	 echo $str[0].$i;
	  ?></td>
      <td>&nbsp;<?php echo "$rowSub[asset_location]";?></td>
      <td>&nbsp;<?php echo "$rowSub[asset_latitude]";?></td>
      <td>&nbsp;<?php echo "$rowSub[asset_longitude]";?></td>
      <td>&nbsp;<?php echo "$rowSub[asset_status]";?></td>
      <td>&nbsp;<?php echo "$rowSub[asset_discharge]";?></td>
	  <td>&nbsp;<?php echo "$rowSub[asset_head]";?></td>
      <td width="90">&nbsp;<?php echo "$rowSub[asset_power]";?></td>
      <td width="11" align="center"><a href="asset1rwss_edit_view.php?var=<?php echo $rowSub['id'];?>& referenceId=<?php echo $reference_id;?>& str=<?php echo $str[0];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
      <td width="15" align="center"><a href="assetrwss_delete_view.php?var=<?php echo $rowSub['id'];?>& loc=<?php echo $rowSub['loc_id'];?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
    </tr>
	<?php 
	$i++;
 		}
	?>
    <tr style="background-color:#CCCCCC">
      <td colspan="8">&nbsp;<b>Mono Block</b></td>
      <td colspan="2" align="right"><a href="assetrwss_add_view.php?addloc=<?php echo $id1;?>& referenceId=<?php echo $reference_id;?>& code=2" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" border="0" title="ADD RECORD" /></a></td>
    </tr>
    <tr>
      <td>&nbsp;<b>Mono Block</b></td>
     <td width="93">&nbsp;<b>Location</b></td>
      <td width="80">&nbsp;<b>Latitude</b></td>
      <td width="93">&nbsp;<b>Longitude</b></td>
      <td width="66">&nbsp;<b>Status</b></td>
      <td width="98" style="padding-left:5px"><b>Discharge (lpm)</b></td>
	  <td width="57" style="padding-left:5px"><b>Head (m)</b></td>
      <td colspan="3" style="padding-left:5px"><b>Power Rating (in HP)</b></td>
    </tr>
	<?php
	$i=1;
	$qryMono="select * from tbl_dtls_q1_asset where loc_id='$id1' and asset_id LIKE 'mono%' order by 0+replace(asset_id,'mono','')";
		$resMono=mysql_query($qryMono);
		while($rowMono=mysql_fetch_array($resMono))
		{
	?> 
	<tr>
      <td>&nbsp;<?php //echo "$rowMono[asset_id]";
	    $str= preg_split("/[0-9]/", $rowMono['asset_id']);
	    echo $str[0].$i;
	  ?></td>
       <td>&nbsp;<?php echo "$rowMono[asset_location]";?></td>
      <td>&nbsp;<?php echo "$rowMono[asset_latitude]";?></td>
      <td>&nbsp;<?php echo "$rowMono[asset_longitude]";?></td>
      <td>&nbsp;<?php echo "$rowMono[asset_status]";?></td>
      <td>&nbsp;<?php echo "$rowMono[asset_discharge]";?></td>
	  <td>&nbsp;<?php echo "$rowMono[asset_head]";?></td>
      <td>&nbsp;<?php echo "$rowMono[asset_power]";?></td>
      <td align="center"><a href="asset1rwss_edit_view.php?var=<?php echo $rowMono['id'];?>& referenceId=<?php echo $reference_id;?>& str=<?php echo $str[0];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td align="center"><a href="assetrwss_delete_view.php?var=<?php echo $rowMono['id'];?>& loc=<?php echo $rowMono['loc_id'];?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
	</tr>
	<?php 
	$i++;
 		}
	?>
	  <tr>
      <td colspan="8" style="background-color:#CCCCCC">&nbsp;<b>Centrifugal</b></td>
      <td colspan="2" align="right" style="background-color:#CCCCCC"><a href="assetrwss_add_view.php?addloc=<?php echo $id1;?>& referenceId=<?php echo $reference_id;?>& code=3" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" border="0" title="ADD RECORD" /></a></td>
	  </tr>
    <tr>
      <td>&nbsp;<b>Centrifugal</b></td>
     <td width="93">&nbsp;<b>Location</b></td>
      <td width="80">&nbsp;<b>Latitude</b></td>
      <td width="93">&nbsp;<b>Longitude</b></td>
      <td width="66">&nbsp;<b>Status</b></td>
      <td width="98" style="padding-left:5px"><b>Discharge (lpm)</b></td>
	  <td width="57" style="padding-left:5px"><b>Head (m)</b></td>
      <td colspan="3" style="padding-left:5px"><b>Power Rating (in HP)</b></td>
    </tr>
	<?php
	$i=1;
		$qryCentri="select * from tbl_dtls_q1_asset where loc_id='$id1' and asset_id LIKE 'centi%' order by 0+replace(asset_id,'centi','')";
		$resCentri=mysql_query($qryCentri);
		while($rowCentri=mysql_fetch_array($resCentri))
		{
	?> 
	<tr>
      <td>&nbsp;<?php //echo "$rowCentri[asset_id]";
	   $str= preg_split("/[0-9]/", $rowCentri['asset_id']);
	   echo $str[0].$i;
	  ?></td>
      <td>&nbsp;<?php echo "$rowCentri[asset_location]";?></td>
      <td>&nbsp;<?php echo "$rowCentri[asset_latitude]";?></td>
      <td>&nbsp;<?php echo "$rowCentri[asset_longitude]";?></td>
      <td>&nbsp;<?php echo "$rowCentri[asset_status]";?></td>
      <td>&nbsp;<?php echo "$rowCentri[asset_discharge]";?></td>
	  <td>&nbsp;<?php echo "$rowCentri[asset_head]";?></td>
      <td>&nbsp;<?php echo "$rowCentri[asset_power]";?></td>
      <td align="center"><a href="asset1rwss_edit_view.php?var=<?php echo $rowCentri['id'];?>& referenceId=<?php echo $reference_id;?>& str=<?php echo $str[0];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td align="center"><a href="assetrwss_delete_view.php?var=<?php echo $rowCentri['id'];?>& loc=<?php echo $rowCentri['loc_id'];?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
	</tr> 
	<?php 
	$i++;
 		}
	?>
	<tr style="background-color:#CCCCCC">
      <td colspan="8">&nbsp;<b>Single Phase</b></td>
      <td colspan="2" align="right"><a href="assetrwss_add_view.php?addloc=<?php echo $id1;?>& referenceId=<?php echo $reference_id;?>& code=4" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" border="0" title="ADD RECORD" /></a></td>
	</tr>
    <tr>
      <td>&nbsp;<b>Single Phase</b></td>
     <td width="93">&nbsp;<b>Location</b></td>
      <td width="80">&nbsp;<b>Latitude</b></td>
      <td width="93">&nbsp;<b>Longitude</b></td>
      <td width="66">&nbsp;<b>Status</b></td>
      <td width="98" style="padding-left:5px"><b>Discharge (lpm)</b></td>
	  <td width="57" style="padding-left:5px"><b>Head (m)</b></td>
      <td colspan="3" style="padding-left:5px"><b>Power Rating (in HP)</b></td>
    </tr>
	<?php
	$i=1;
		$qrySp="select * from tbl_dtls_q1_asset where loc_id='$id1' and asset_id LIKE 'Sp%' order by 0+replace(asset_id,'Sp','')";
		$resSp=mysql_query($qrySp);
		while($rowSp=mysql_fetch_array($resSp))
		{
	?>  
	<tr>
      <td>&nbsp;<?php //echo "$rowSp[asset_id]";
	   $str= preg_split("/[0-9]/", $rowSp['asset_id']);
	   echo $str[0].$i;
	  ?></td>
   	 <td>&nbsp;<?php echo "$rowSp[asset_location]";?></td>
      <td>&nbsp;<?php echo "$rowSp[asset_latitude]";?></td>
      <td>&nbsp;<?php echo "$rowSp[asset_longitude]";?></td>
      <td>&nbsp;<?php echo "$rowSp[asset_status]";?></td>
      <td>&nbsp;<?php echo "$rowSp[asset_discharge]";?></td>
	  <td>&nbsp;<?php echo "$rowSp[asset_head]";?></td>
      <td>&nbsp;<?php echo "$rowSp[asset_power]";?></td>
      <td align="center"><a href="asset1rwss_edit_view.php?var=<?php echo $rowSp['id'];?>& referenceId=<?php echo $reference_id;?>& str=<?php echo $str[0];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td align="center"><a href="assetrwss_delete_view.php?var=<?php echo $rowSp['id'];?>& loc=<?php echo $rowSp['loc_id'];?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
	</tr> 
	<?php 
	$i++;
 		}
	?>
  </table>
 </div>  <!-- End of Section5  -->
 </td></tr>
<tr><td colspan="2" bgcolor="#C5D8EB">
  <a href="javascript:animatedcollapse.toggle('section6')">
  <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;6. Assets (As in records) index map for regional scheme to be provided in whatever form is available</div></a>
  </td></tr>
  <tr><td colspan="2">
  <div id="section6" class="section_format">
  <table border="1">
    
    <tr style="background-color:#DADADA">
      <td colspan="9">&nbsp;<b>Reservoirs</b></td>
      </tr>
	  <tr style="background-color:#DADADA">
      <td colspan="7">&nbsp;<b>Clear Water Reservoir (CWR) - Underground&nbsp;&nbsp;<!--|&nbsp;&nbsp;Nos.-<?php //echo $row['cwr_total'];?></b>--></td>
      <td colspan="2" align="right"><a href="reservrwss_add_view.php?addloc=<?php echo $id1;?>&amp; referenceId=<?php echo $reference_id;?>&amp; code=1" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" alt="Add record" border="0" title="ADD RECORD" /></a></td>
	  </tr>
    <tr style="background-color:#CCCCCC">
      <td width="134">&nbsp;<b>CWR</b></td>
      <td width="134">&nbsp;<b>Location</b> </td>
      <td width="134">&nbsp;<b>Latitude</b></td>
      <td width="134">&nbsp;<b>Longitude</b></td>
      <td colspan="2">&nbsp;<b>Capacity(kl)</b></td>
      <td width="339">&nbsp;<b>In SC/ST Bastis</b></td>
      <td colspan="2">&nbsp;<?php echo "$row[cwr_sc_st]";?></td>
    </tr>
	 <?php
		$qryCWR="select * from tbl_dtls_q1_reserv where loc_id='$id1' and reserv_id LIKE 'CWR%' order by 0+replace(reserv_id,'CWR','')";
		$resCWR=mysql_query($qryCWR);
		$i=0;
		
	
		while($rowCWR=mysql_fetch_assoc($resCWR))
		{
		$i++;
	?>                  
    <tr>
      <td>&nbsp;<?php 
	    $str= preg_split("/[0-9]/", $rowCWR['reserv_id']);
	  	echo $str[0].$i; ?></a></td>
      <td>&nbsp;<?php echo "$rowCWR[reserv_location]";?></td>
      <td>&nbsp;<?php echo "$rowCWR[reserv_latitude]";?></td>
      <td>&nbsp;<?php echo "$rowCWR[reserv_longitude]";?></td>
      <td colspan="2">&nbsp;<?php echo "$rowCWR[reserv_cap]"; ?></td>
      <td>&nbsp;<?php echo $rowCWR['reserv_scst']; ?></td>
   <td width="21" align="center"> <a href="reserv1rwss_edit_view.php?var=<?php echo $rowCWR['id'];?>& referenceId=<?php echo $reference_id;?>& str=<?php echo $str[0];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td width="18" align="center"><a href="reservrwss_delete_view.php?var=<?php echo $rowCWR['id'];?>& loc=<?php echo $rowCWR['loc_id'];?>&&code=CWR" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
    </tr>
	<?php 
 		}
	?>
    
	
    <tr style="background-color:#DADADA">
      <td colspan="7">&nbsp;<b>Ground Level Service Reservoir (GLSR)&nbsp;&nbsp;<!--|&nbsp;&nbsp;Nos.-<?php //echo $row['glsr_total'];?></b>--></td>
	  <td colspan="2" align="right"><a href="reservrwss_add_view.php?addloc=<?php echo $id1;?>&amp; referenceId=<?php echo $reference_id;?>&amp; code=2" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" alt="Add record" border="0" title="ADD RECORD" /></a></td>
      </tr>
    <tr style="background-color:#CCCCCC">
      <td>&nbsp;<b>GLSR</b></td>
      <td width="134">&nbsp;<b>Location</b> </td>
      <td width="134">&nbsp;<b>Latitude</b></td>
      <td width="134">&nbsp;<b>Longitude</b></td>
      <td colspan="2">&nbsp;<b>Capacity(kl)</b></td>
      <td>&nbsp;<b>In SC/ST Bastis</b></td>
      <td colspan="2">&nbsp;<?php echo "$row[glsr_sc_st]";?></td>
    </tr>
	<?php
		$qryGLSR="select * from tbl_dtls_q1_reserv where loc_id='$id1' and reserv_id LIKE 'GLSR%' order by 0+replace(reserv_id,'GLSR','')";
		$resGLSR=mysql_query($qryGLSR);
		$i=0;
		while($rowGLSR=mysql_fetch_array($resGLSR))
		{
		$i++;
	?>                  
	<tr>
      <td>&nbsp;<?php 	  $str= preg_split("/[0-9]/", $rowGLSR['reserv_id']);
	   						echo $str[0].$i; ?></a></td>
      <td>&nbsp;<?php echo "$rowGLSR[reserv_location]";?></td>
      <td>&nbsp;<?php echo "$rowGLSR[reserv_latitude]";?></td>
      <td>&nbsp;<?php echo "$rowGLSR[reserv_longitude]";?></td>
      <td colspan="2">&nbsp;<?php echo "$rowGLSR[reserv_cap]";?></td>
      
	  <td>&nbsp;<?php echo $rowGLSR['reserv_scst']; ?></td>
       <td align="center"> <a href="reserv1rwss_edit_view.php?var=<?php echo $rowGLSR['id'];?>& referenceId=<?php echo $reference_id;?>& str=<?php echo $str[0];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td align="center"><a href="reservrwss_delete_view.php?var=<?php echo $rowGLSR['id'];?>& loc=<?php echo $rowGLSR['loc_id'];?>&&code=2" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
	</tr>
	<?php 
 		}
	?>
	
	
	  <tr style="background-color:#DADADA">
      <td colspan="7">&nbsp;<b>Ground Level Reservoir (GLR)&nbsp;&nbsp;<!--|&nbsp;&nbsp;Nos.-<?php //echo $row['glr_total']; ?></b>--></td>
	  <td colspan="2" align="right"><a href="reservrwss_add_view.php?addloc=<?php echo $id1;?>&amp; referenceId=<?php echo $reference_id;?>&amp; code=3" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" alt="Add record" border="0" title="ADD RECORD" /></a></td>
      </tr>
    <tr style="background-color:#CCCCCC">
      <td>&nbsp;<b>GLR</b></td>
      <td width="134">&nbsp;<b>Location</b> </td>
      <td width="134">&nbsp;<b>Latitude</b></td>
      <td width="134">&nbsp;<b>Longitude</b></td>
      <td colspan="2">&nbsp;<b>Capacity(kl)</b></td>
      <td>&nbsp;<b>In SC/ST Bastis</b></td>
      <td colspan="2">&nbsp;<?php echo "$row[glr_sc_st]";?></td>
    </tr>
	<?php
		$qryGLR="select * from tbl_dtls_q1_reserv where loc_id='$id1' and reserv_id LIKE 'GLR%' order by 0+replace(reserv_id,'GLR','')";
		$resGLR=mysql_query($qryGLR);
		$i=0;
		while($rowGLR=mysql_fetch_array($resGLR))
		{
		$i++;
	?>                               
	<tr>
      <td>&nbsp;<?php 	  $str= preg_split("/[0-9]/", $rowGLR['reserv_id']);
	   						echo $str[0].$i; ?></a></td>
      <td>&nbsp;<?php echo "$rowGLR[reserv_location]";?></td>
      <td>&nbsp;<?php echo "$rowGLR[reserv_latitude]";?></td>
      <td>&nbsp;<?php echo "$rowGLR[reserv_longitude]";?></td>
      <td colspan="2">&nbsp;<?php echo "$rowGLR[reserv_cap]"; ?></td>
      
	  <td>&nbsp;<?php echo $rowGLR['reserv_scst']; ?></td>
       <td align="center"> <a href="reserv1rwss_edit_view.php?var=<?php echo $rowGLR['id'];?>& referenceId=<?php echo $reference_id;?>& str=<?php echo $str[0];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td align="center"><a href="reservrwss_delete_view.php?var=<?php echo $rowGLR['id'];?>& loc=<?php echo $rowGLR['loc_id'];?>&&code=3" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>	</tr>
	<?php 
 		}
	?>
	 
	
	<tr style="background-color:#DADADA">
      <td colspan="7">&nbsp;<b>Over Head Service Reservoir (OHSR)&nbsp;&nbsp;<!--|&nbsp;&nbsp;Nos.-<?php //echo $row['ohsr_total'];?></b>--></td>
      <td colspan="2" align="right"><a href="reservrwss_add_view.php?addloc=<?php echo $id1;?>&amp; referenceId=<?php echo $reference_id;?>&amp; code=4" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" alt="Add record" border="0" title="ADD RECORD" /></a></td>
	  </tr>
    <tr style="background-color:#CCCCCC">
      <td>&nbsp;<b>OHSR</b></td>
      <td width="134">&nbsp;<b>Location</b> </td>
      <td width="134">&nbsp;<b>Latitude</b></td>
      <td width="134">&nbsp;<b>Longitude</b></td>
      <td colspan="2">&nbsp;<b>Capacity(kl)</b></td>
      <td>&nbsp;<b>In SC/ST Bastis</b> </td>
      <td colspan="2">&nbsp;<?php echo "$row[ohsr_sc_st]";?></td>
    </tr>
	 <?php
		$qryOHSR="select * from tbl_dtls_q1_reserv where loc_id='$id1' and reserv_id LIKE 'OHSR%' order by 0+replace(reserv_id,'OHSR','')";
		$resOHSR=mysql_query($qryOHSR);
		$i=0;
		while($rowOHSR=mysql_fetch_array($resOHSR))
		{
		$i++;
			if($rowOHSR[reserv_id]!=0 || $rowOHSR[reserv_cap]!=0 || $rowOHSR[reserv_id]!='' || $rowOHSR[reserv_cap]!='')
			{
	?>                  
	<tr>
      <td>&nbsp;<?php 	  $str= preg_split("/[0-9]/", $rowOHSR['reserv_id']);
	   						echo $str[0].$i; ?></td>
      <td>&nbsp;<?php echo "$rowOHSR[reserv_location]";?></td>
      <td>&nbsp;<?php echo "$rowOHSR[reserv_latitude]";?></td>
      <td>&nbsp;<?php echo "$rowOHSR[reserv_longitude]";?></td>
      <td colspan="2">&nbsp;<?php echo "$rowOHSR[reserv_cap]";?></a></td>
      
	  <td>&nbsp;<?php echo $rowOHSR['reserv_scst']; ?></td>
       <td align="center"> <a href="reserv1rwss_edit_view.php?var=<?php echo $rowOHSR['id'];?>& referenceId=<?php echo $reference_id;?>& str=<?php echo $str[0];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td align="center"><a href="reservrwss_delete_view.php?var=<?php echo $rowOHSR['id'];?>& loc=<?php echo $rowOHSR['loc_id'];?>&&code=4" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
	</tr>
	<?php 
	}
	else
	{
		echo "<tr><td colspan=5>No Record Found</td><tr>";
	}
 		}
	?>
  </table>
 </div>  <!-- End of Section6  -->
 </td></tr>
 <tr>
<td colspan="2" bgcolor="#C5D8EB">
  <a href="javascript:animatedcollapse.toggle('section7')">
  <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;<b>7. Pipelines (Rising Main)</b></div></a>  </td></tr>
  <tr><td colspan="2">
  <div id="section7"  class="section_format">	
  <table border="1">
    <tr>
      <td colspan="6" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="pipelinerwss_add.php?addloc=<?php echo $id1;?>&referenceId=<?php echo $reference_id;?>&code=1" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" border="0" title="ADD RECORD" /></a></div></td>
      </tr>
    <tr style="background-color:#CCCCCC">
      <td width="157">&nbsp;<b>Material</b></td>
      <td width="162">&nbsp;<b>Size(mm)</b></td>
      <td colspan="3">&nbsp;<b>Length (Km)</b></td>
      </tr>
	<?php
		$qryRising="select * from tbl_dtls_q1_pipeline_ris_dis where loc_id='$id1' and rising_material!='0' and rising_material!='' ";
		$resRising=mysql_query($qryRising);
		while($rowRising=mysql_fetch_array($resRising))
		{
			?>  
    <tr>
      <td>&nbsp;<?php echo "$rowRising[rising_material]";?></td>
      <td>&nbsp;<?php echo "$rowRising[rising_size]";?></td>
      <td width="388">&nbsp;<?php echo "$rowRising[rising_length]";?></td>
      <td width="22" align="center"><a href="pipelinerwss_edit.php?var=<?php echo $rowRising['id'];?>&&referenceId=<?php echo $reference_id;?>&&code=1 " rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td width="17" align="center"><a href="pipelinerwss_delete.php?var=<?php echo $rowRising['id'];?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
    </tr>
	<?php }?>
    <tr>
      <td colspan="6">&nbsp;</td>
      </tr>
  </table>
  </div>  <!-- End of section7  -->
  </td></tr>
<tr>
<td colspan="2" bgcolor="#C5D8EB">
  <a href="javascript:animatedcollapse.toggle('section8')">
  <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;<b>8. Pipelines (Distribution Main)</b></div></a>  </td></tr>
  <tr><td colspan="2">
  <div id="section8"  class="section_format">	
  <table border="1">
    <tr>
      <td colspan="7" align="right"><a href="pipelinerwss_add.php?addloc=<?php echo $id1;?>&amp; referenceId=<?php echo $reference_id;?>&amp; code=2" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" alt="Add Record" border="0" title="ADD RECORD" /></a></td>
      </tr>
    <tr style="background-color:#CCCCCC">
      <td width="175">&nbsp;<b>Material</b></td>
      <td width="198">&nbsp;<b>Size(mm)</b></td>
      <td colspan="5">&nbsp;<b>Length (Km)</b></td>
      </tr>
	<?php
		$qryDistri="select * from tbl_dtls_q1_pipeline_ris_dis where loc_id='$id1' and distri_material!='0' and distri_material!=''";
		$resDistri=mysql_query($qryDistri);
		while($rowDistri=mysql_fetch_array($resDistri))
		{
			?>  
    <tr>
      <td>&nbsp;<?php echo "$rowDistri[distri_material]";?></td>
      <td>&nbsp;<?php echo "$rowDistri[distri_size]";?></td>
      <td width="335">&nbsp;<?php echo "$rowDistri[distri_length]";?></td>
      <td width="24" align="center"><a href="pipelinerwss_edit.php?var=<?php echo $rowDistri['id'];?>&&referenceId=<?php echo $reference_id;?>&&code=2" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
	  <td width="14" align="center"><a href="pipelinerwss_delete.php?var=<?php echo $rowDistri['id'];?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
    </tr>
	<?php }?>
    <tr>
      <td colspan="7">&nbsp;</td>
      </tr>
  </table>
  </div>  <!-- End of section8  -->
  </td></tr>
<tr>
<td colspan="2" bgcolor="#C5D8EB">
  <a href="javascript:animatedcollapse.toggle('section9')">
  <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;<b>9. Public Stand Post (PSP)</b></div></a>  </td></tr>
  <tr><td colspan="2">
  <div id="section9"  class="section_format">	
  <table border="1">
    <tr>
      <td colspan="11" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="psprwss_add.php?addloc=<?php echo $id1;?>&amp; referenceId=<?php echo $reference_id;?>" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" alt="Add Record" border="0" title="ADD RECORD" /></a></div></td>
      </tr>
    <tr style="background-color:#DADADA">
      <td colspan="4">&nbsp;<b><b>Total No. of PSP</b> </td>
      <td colspan="5">&nbsp;<b>In SC / ST Bastis</b></td>
      </tr>
	 
    <tr bgcolor="#cccccc">
      <td width="122">&nbsp;<b>Taps/PSP Nos.</b></td>
      <td width="115">&nbsp;<b>Location</b></td>
      <td width="96">&nbsp;<b>Latitude</b></td>
      <td width="93">&nbsp;<b>Longitude</b></td>
      <td width="89"><b>Attached with (GLR)</b></td>
      <td width="88"><b>Attached with CWT (Cattle water trough)</b></td>
      <td><b>In SC/ST Basti</b></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
	<?php
		$qryPSP="select * from tbl_dtls_q1_psp where loc_id='$id1'";
		$resPSP=mysql_query($qryPSP);
		while($rowPSP=mysql_fetch_array($resPSP))
		{
			?>  
    <tr>
      <td>&nbsp;<?php echo "$rowPSP[psp_taps]";?></td>
      <td style="padding-left:5px"><?php echo "$rowPSP[psp_loc]";?></td>
      <td>&nbsp;<?php echo $rowPSP['psp_lat']; ?></td>
      <td>&nbsp;<?php echo $rowPSP['psp_long']; ?></td>
      <td>&nbsp;<?php echo "$rowPSP[attached_glr]";?></td>
      <td>&nbsp;<?php echo "$rowPSP[attached_cwt]";?></td>
      <td width="75">&nbsp;<?php echo "$rowPSP[sc_st]";?></td>
      <td width="20" align="center"><a href="psprwss_edit.php?var=<?php echo $rowPSP['id'];?>&amp;&amp;referenceId=<?php echo $reference_id;?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
      <td width="24" align="center"><a href="psprwss_delete.php?var=<?php echo $rowPSP['id'];?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
    </tr>
	<?php }?>
    <tr>
      <td colspan="10">&nbsp;</td>
      </tr>
  </table>
  </div>  <!-- End of section8  -->  </td></tr>
<tr><td colspan="2" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section10')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;10. Operational Aspect</div>
   </a>
 </td> </tr>
  <tr><td colspan="2">
   <div id="section10" class="section_format">	
  <table border="1">
  <?php
  $qryOperational="select * from tbl_dtls_q1_last where loc_id='$frm'";
  $recOperational=mysql_query($qryOperational);
  $rowOperational=mysql_fetch_array($recOperational);
  ?>
    <tr>
      <td colspan="4" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="operationalrwss_aspect.php?loc_id=<?php echo $rowOperational['loc_id']; ?>" rel="facebox" style="text-decoration:none"><img src="images/edit.gif" border="0" title="EDIT RECORD" /></a></div></td>
      </tr>
    <tr>
      <td width="386">&nbsp;<b>1. Current Status of Schemes</b></td>
      <td colspan="3">&nbsp;<?php echo "$rowOperational[current_status]";?></td>
      </tr>
    <tr>
      <td>&nbsp;<b>2. Actual Water Supplied (KLD)</b></td>
      <td colspan="3">&nbsp;<?php echo "$rowOperational[water_supply]";?></td>
      </tr>
    <tr>
      <td>&nbsp;<b>3. Frequency of Supply</b></td>
      <td colspan="3">&nbsp;<?php echo "$rowOperational[freq_supply]";?></td>
    </tr>
    <tr>
      <td>&nbsp;<b>4. Duration of supply (hrs/ day)</b></td>
      <td colspan="3">&nbsp;<?php echo "$rowOperational[duration_supply]";?></td>
      </tr>
	  <tr>
      <td>&nbsp;<b>5. Disinfection Process</b></td>
      <td colspan="3">&nbsp;</td>
      </tr>
	  <tr>
	    <td>&nbsp;&nbsp;<b>I) Type of disinfection</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[type_disinfection]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;&nbsp;<b>II) Frequency</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[freq]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;&nbsp;<b>III) Quantity of chemical Used / KL</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[quant_chemical]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;<b>6. Total Manpower deployed in O &amp; M</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[manpwr_total]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;&nbsp;&nbsp;<b>Total Technical personnel(Nos.)</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[tech_emp]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;<b>7. Existing means to quantify water supplied</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[existing_means]";?></td>
	    </tr>
	  <tr>
	    <td rowspan="4" valign="top"><b>8. Water Connections</b></td>
	    <td width="190" colspan="2" style="background-color:#DADADA">&nbsp;<b>Type</b></td>
	    <td width="182" style="background-color:#DADADA">&nbsp;<b>Nos.</b></td>
	  </tr>
	  <tr>
	    <td colspan="2"><b>Domestic</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[domestic_no]";?></td>
	  </tr>
	  <tr>
	    <td colspan="2"><b>Non Domestic </b></td>
	    <td>&nbsp;<?php echo "$rowOperational[nondomestic_no]";?></td>
	  </tr>
	  <tr>
	    <td colspan="2"><b>Industrial</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[industrial_no]";?></td>
	  </tr>
	  <tr>
	    <td rowspan="4" valign="top">&nbsp;<b>9. Water Billing System</b></td>
	    <td colspan="2" style="background-color:#DADADA">&nbsp;<b>Type</b></td>
	    <td style="background-color:#DADADA">&nbsp;<b>Nos.</b></td>
	  </tr>
	  <tr>
	    <td colspan="2"><b>Domestic</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[domestic_system]";?></td>
	  </tr>
	  <tr>
	    <td colspan="2"><b>Non Domestic</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[nondomestic_system]";?></td>
	  </tr>
	  <tr>
	    <td colspan="2"><b>Industrial</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[industrial_system]";?></td>
	  </tr>
	  <tr>
	    <td rowspan="2" valign="top">&nbsp;<b>10. Water Bills Raised (in <img src="images/26rup1.jpg" width="10"> Lakhs)</b></td>
	    <td style="background-color:#DADADA"><b>2009-10</b></td>
	    <td style="background-color:#DADADA"><b>2008-09</b></td>
	    <td style="background-color:#DADADA"><b>2007-08</b></td>
	  </tr>
	  <tr>
	    <td>&nbsp;<?php echo "$rowOperational[wbs_9_10]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[wbs_8_9]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[wbs_7_8]";?></td>
	  </tr>
	  <tr>
	    <td>&nbsp;<b>11. Revenue Generated (in <img src="images/26rup1.jpg" width="10"> Lakhs)</b></td>
	    <td style="background-color:#DADADA"><b>2009-10</b></td>
	    <td style="background-color:#DADADA"><b>2008-09</b></td>
	    <td style="background-color:#DADADA"><b>2007-08</b></td>
	  </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td>&nbsp;<?php echo "$rowOperational[rg_9_10]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[rg_8_9]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[rg_7_8]";?></td>
	  </tr>
	  <tr>
	    <td>&nbsp;<b>12. Annual Operations Maintenance Cost &nbsp;(in <img src="images/26rup1.jpg" width="10"> Lakhs)</b></td>
	    <td style="background-color:#DADADA"><b>FY 2009-10</b></td>
	    <td style="background-color:#DADADA">&nbsp;<b>FY 2008-09</b></td>
	    <td style="background-color:#DADADA"><b>FY 2007-08</b></td>
	  </tr>
	  <tr>
	    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Man Power Cost</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[mpc_9_10]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[mpc_8_9]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[mpc_7_8]";?></td>
	  </tr>
	  <tr>
	    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Material Cost - Machinery Repairs</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[mc_mr_9_10]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[mc_mr_8_9]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[mc_mr_7_8]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Material Cost - Pipe Repairs</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[mc_pr_9_10]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[mc_pr_8_9]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[mc_pr_7_8]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Power Cost</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[pc_9_10]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[pc_8_9]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[pc_7_8]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Chemicals Cost</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[cc_9_10]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[cc_8_9]";?></td>
	    <td>&nbsp;<?php echo "$rowOperational[cc_7_8]";?></td>
	    </tr>
	  <tr>
	    <td colspan="3">&nbsp;<b>13. Preventive Maintenance Mechanism in Place</b></td>
	    <td>&nbsp;<?php echo "$rowOperational[preventive_place]";?></td>
	  </tr>
	  <tr>
	    <td colspan="4">&nbsp;</td>
	    </tr>
	  <tr style="background-color:#DADADA">
	    <td colspan="4"><b>Complaint 
			Redressal Mechanism</b></td>
	    </tr>
	  <tr>
	    <td>&nbsp;<b>1. Existing Reporting system</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[existing_report]";?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;<b>2. Time Taken to address the complaint</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[time_taken]";?></td>
	    </tr>
	  <tr>
	    <td colspan="4">&nbsp;<b>3. Types of Complaint received (avg. per month)</b></td>
	    </tr>
	  <tr>
	    <td>&nbsp;<b>Non Supply of water due to power failure</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[complaint_1]";?><?php if($row2[complaint_1]!=""){echo "%";} ?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;<b>Poor Water Quality</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[complaint_2]";?><?php if($row2[complaint_2]!=""){echo "%";} ?></td>
	    </tr>
	  <tr>
	    <td><b>Absence of PHED field Staff</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[complaint_3]";?><?php if($row2[complaint_3]!=""){echo "%";} ?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;<b>Polluted sources of drinking water</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[complaint_4]";?><?php if($row2[complaint_4]!=""){echo "%";} ?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;<b>Distribution of Water supply due to poorly 
							maintained Water Supply Infrastructure</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[complaint_5]";?><?php if($row2[complaint_5]!=""){echo "%";} ?></td>
	    </tr>
	  <tr>
	    <td>&nbsp;</td>
	    <td colspan="3">&nbsp;</td>
	    </tr>
	  <tr style="background-color:#DADADA">
	    <td colspan="4">&nbsp;<b>Constraint / Issues Faced by PHED officials</b></td>
	    </tr>
	  <tr>
	    <td><b>Institutional</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[institutional]";?></td>
	    </tr>
	  <tr>
	    <td><b>Financial</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[financial]";?></td>
	    </tr>
	  <tr>
	    <td><b>Operational</b></td>
	    <td colspan="3">&nbsp;<?php echo "$rowOperational[operational]";?></td>
	    </tr>
  </table>
  </div>   <!-- End of section10  -->
 </td></tr>
<tr><td colspan="2" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section11')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;11. Critical Habitation</div>
   </a>
 </td> </tr>
  <tr><td colspan="2"> 
   <div id="section11" class="section_format">	
  <table width="998" border="1">
    
	  <tr style="background-color:#DADADA">
      <td width="180">&nbsp;<b>Habitation Name</b></td>
      <td width="50" align="center"><b>Habitation Type</b></td>
      <td colspan="2">&nbsp;<b>Critical</b></td>
      </tr>
	  <?php
		$qryCritical="select * from tbl_dtls_q1_critical where loc_id='$id1' order by critical_hcode asc";
		$resCritical=mysql_query($qryCritical);
		$i=1;
		while($rowCritical=mysql_fetch_array($resCritical))
		{
		?>
    
    <tr> 
      <td>&nbsp;<?php echo "$rowCritical[critical_hname]";?></td>
      <td>&nbsp;<?php echo "$rowCritical[type_habit]";?></td>
	  <td width="519"> &nbsp; <?php echo "$rowCritical[critical]";?> </td> 
	  <td width="15" align="center"><a href="criticalrwss_edit_view.php?var=<?php echo $rowCritical['id'];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="10" height="10" border="0" title="Edit individual record" /></a></td>
    </tr> 
	<?php
	if($rowCritical['critical']!="no")
	{
	?>
      <tr>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td colspan="2">
							<table width="331" border="1" id="table16" style="width:540px;">
							<tr>
								<td width="567">
								&nbsp; 
								Critical Village in terms of quality </td>
							</tr>
							<tr>
								<td>&nbsp;<?php echo "$rowCritical[CH_quality]";?></td>
							</tr>
							<tr>
								<td>&nbsp;
								Critical Village in terms of quantity </td>
							</tr>
							<tr>
								<td>&nbsp;<?php echo "$rowCritical[CH_quantity]";?></td>
				    		</tr>
						</table>						</td>
			</tr>
	
    
	<?php }}?>
    <tr>
      <td colspan="4">&nbsp;</td>
      </tr>
  </table>
  </div>   <!-- End of section11 -->
</td></tr>
<tr><td colspan="2" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section12')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;12. Water Supply by Tankers</div>
   </a>
 </td> </tr>
  <tr><td colspan="2">
   <div id="section12" class="section_format">	

  <table border="1">
    
	  <tr style="background-color:#DADADA">
      <td width="170" style="padding-left:5px"><b>Habitation Name</b></td>
      <td width="99" style="padding-left:5px"><b>Habitation Type</b></td>
      <td width="74" style="padding-left:5px"><b>Tanker Nos.</b></td>
      <td width="86" style="padding-left:5px"><b>Quantity (KLD)</b></td>
      <td width="89" style="padding-left:5px"><b>Area Covered</b></td>
	  <td width="109">&nbsp;<b>From(date)</b> </td>
	  <td width="87">&nbsp;<b>To(date)</b></td>
	  <td width="14">&nbsp;</td>
	  </tr>
	  <?php
						$qryTanker="select * from tbl_dtls_q1_tanker where loc_id='$id1' order by habitation_code asc";
						$resTanker=mysql_query($qryTanker);
						while($rowTanker=mysql_fetch_array($resTanker))
						{
					?>
    <tr>
      <td style="padding-left:3px"><?php echo "$rowTanker[habitation_name]";?></td>
      <td>&nbsp;<?php echo "$rowTanker[type_habit]";?></td>
      <td>&nbsp;<?php echo "$rowTanker[total_tanker_no]";?></td>
      <td>&nbsp;<?php echo "$rowTanker[water_quantity]";?></td>
      <td><?php echo "$rowTanker[area_covered]";?></td>
      <td>&nbsp;<?php echo "$rowTanker[from_date]";?></td>
	  <td>&nbsp;<?php echo "$rowTanker[to_date]";?></td>
      <td align="center"><a href="tankerrwss_supply_edit_q1.php?var=<?php echo $rowTanker['id'];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
    </tr>
    <?php
	}?>
		  <tr>
      <td colspan="8">&nbsp;</td>
      </tr>
  </table>
  </div>   <!-- End of section12  -->
 <tr><td colspan="2" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section13')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;13. Index Map</div>
   </a>
 </td> </tr>
  <tr><td colspan="2">
   <div id="section13" class="section_format">	

  <table border="1">
    
	  <tr style="background-color:#DADADA">
      <td width="523" style="padding-left:5px"> 
	  <?php 
				
				  if($row[index_map]!="")
				  {
				  

                    //$qrVillage="select * from tbl_dtls_q1_main where loc_id='$id1'";
                    //$resVillage=mysql_query($qrVillage);
                    //$rowVillage=mysql_fetch_array($resVillage);
					$Final_Path=$dis_name;//$rowVillage['district'] ;
                    $path = "index_map_rwss/$Final_Path/"; // change the path to fit your websites document structure
                    $fullPath = $path.$row['index_map'];
                    echo  $fullPath;

				  echo $row['index_map'];
				  }
				  else
				  {
				  	echo "No any Index File Uploaded";
				  }
				  ?></td>
      <td width="132" style="padding-left:5px"><a href="index_upload_rwss.php?var=<?php echo $frm;?>" rel="facebox" style="text-decoration:none"><b>Upload</b></a></td>
      <td width="103" style="padding-left:5px">
	 
	  <a href="<?php echo $fullPath;?>" target="_blank"><b>Download</b></a></td>
	  </tr>
	 
		  <tr>
      <td colspan="3">&nbsp;</td>
      </tr>
  </table>
  </div>   <!-- End of section13  -->

</td></tr>
</table>   
<!-- End of Top layer -->
</div>  <!-- End of Main Div-->
</div>